<?php

  /**
   * This class implements all abstract Math methods.<br />
   * You must call every method implemented here as an abstract one.
   * This class has no constructor.
   *
   * @author Dany Mottier
   * @version 1.2.2
   *
   * @see <a href="http://be2.php.net/manual/en/ref.math.php">Math Functions</a>
   */
  abstract class Math {

    /**
     * Absolute value.<br />
     * Returns the absolute value of $number.<br />
     *
     * @param integer $number The numeric value to process.
     *
     * @return float The absoulte value of number. <br />If the argument number  is of type
     * float, the return type is also float, otherwise it is integer (as float
     * usually has a bigger value range than integer).<br /><br />
     *
     * @see <a href="http://be2.php.net/manual/en/function.abs.php">abs()</a>
     */
    public function Absolute($number) {
      return Math::Abs($number);
    }

    /**
     * Alias of Absolute.<br />
     * @see Absolute().
     */
    public function Abs($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return abs($number);
    }

    /**
     * Arc cosine.<br />
     * Returns the arc cosine of $number in radians.<br />
     *
     * @param integer $number The argument to process.
     * @return float The arc consine of arg  in radians.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.acos.php">acos()</a>
     */
    public function ArcCosine($number) {
      return Math::ACos($number);
    }

    /**
     * Alias of ArcCosine().<br />
     * @see ArcCosine().
     */
    public function ACos($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return acos($number);
    }

    /**
     * Inverse hyperbolic cosine.<br />
     * Returns the inverse hyperbolic cosine of $number.<br />
     *
     * @param integer $number The value to process.
     * @return float The inverse hyperbolic cosine of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.acosh.php">acosh()</a>
     */
    public function ArcCosineHyperbolic($number) {
      return Math::ACosH($number);
    }

    /**
     * Alias of ArcCosineHyperbolic().<br />
     * @see ArcCosineHyperbolic().
     */
    public function ACosH($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return acosh($number);
    }

    /**
     * Arc sine.<br />
     * Returns the arc sine of $number in radians.<br />
     *
     * @param integer $number The argument to process.
     * @return float The arc sine of arg  in radians.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.asin.php">asin()</a>
     */
    public function ArcSine($number) {
      return Math::ASin($number);
    }

    /**
     * Alias of ArcSine().<br />
     * @see ArcSine().
     */
    public function ASin($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return asin($number);
    }

    /**
     * Inverse hyperbolic sine.<br />
     * Returns the inverse hyperbolic sine of $number.<br />
     *
     * @param integer $number The argument to process.
     * @return float The inverse hyperbolic sine of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.asinh.php">asinh()</a>
     */
    public function ArcSineHyperbolic($number) {
      return Math::ASinH($number);
    }

    /**
     * Alias of ArcSineHyperbolic().<br />
     * @see ArcSineHyperbolic().
     */
    public function ASinH($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return asinh($number);
    }

    /**
     * Arc tangent of two variables.<br />
     * This public function calculates the arc tangent of the two variables x  and y.
     * It is similar to calculating the arc tangent of y  / x , except that the
     * signs of both arguments are used to determine the quadrant of the
     * result. The public function returns the result in radians, which is between -PI
     * and PI (inclusive).<br />
     *
     * @param $x float Dividend parameter.
     * @param $y float Divisor parameter.
     *
     * @return float The arc tangent of y /x  in radians.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.atan2.php">atan2()</a>
     */
    public function ArcTangent2($x, $y) {
      return Math::Atan2($x, $y);
    }

    /**
     * Alias of ArcTangent2().<br />
     * @see ArcTangent2().
     */
    public function ATan2($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return atan2($number);
    }

    /**
     * Arc tangent.<br />
     * Returns the $number tangent of arg  in radians.<br />
     *
     * @param integer $number The argument to process.
     * @return float The arc tangent of arg  in radians.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.atan.php">atan()</a>
     */
    public function ArcTangent($number) {
      return Math::Atan($number);
    }

    /**
     * Alias of ArcTangent().<br />
     * @see ArcTangent().
     */
    public function Atan($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return atan($number);
    }

    /**
     * Inverse hyperbolic tangent.<br />
     * Returns the inverse hyperbolic tangent of $number.<br />
     *
     * @param integer $number The argument to process.
     * @return Inverse hyperbolic tangent of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.atanh.php">atanh()</a>
     */
    public function ArcTangentHyperbolic($number) {
      return Math::ATanH($number);
    }

    /**
     * Alias of ArcTangentHyperbolic().<br />
     * @see ArcTangentHyperbolic().
     */
    public function ATanH($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return atanh($number);
    }

    /**
     * Convert a number between arbitrary bases.<br />
     * Returns a string containing $number represented in base tobase . The base
     * in which $number is given is specified in frombase. Both frombase and
     * tobase have to be between 2 and 36, inclusive. Digits in numbers with a
     * base higher than 10 will be represented with the letters a-z, with a
     * meaning 10, b meaning 11 and z meaning 35.<br />
     *
     * @param integer $number The number to convert.
     * @param integer $from The base number is in.
     * @param integer $to The base to convert number to.
     * @return string Returns $number converted to base to base.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.base-convert.php">base_convert()</a>
     */
    public function BaseConvert($number, $from, $to) {
      if (Validator::Validate(array($number, $from, $to), Validator::INTEGER))
        return base_convert($number, $from, $to);
    }

    /**
     * Binary to decimal.<br />
     * Returns the decimal equivalent of the binary number represented by the
     * binary_string argument.<br />
     *
     * @param $string The binary string to convert.
     * @return float The decimal value of $string.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.bindec.php">bindec()</a>
     */
    public function BinaryToDecimal($string) {
      return Math::BInDec($string);
    }

    /**
     * Alias of BinaryToDecimal().<br />
     * @see BinaryToDecimal().
     */
    public function BInDec($string) {
      if (Validator::Validate($string, Validator::STRING))
        return bindec($string);
    }

    /**
     * Round fractions up.<br />
     * Returns the next highest integer value by rounding up $number if
     * necessary.<br />
     *
     * @param integer $number The value to round.
     *
     * @return float Returns $number rounded up to the next highest integer.<br />
     * The return value of Ceil() is still of type float as the value range of
     * float is usually bigger than that of integer.<br /><br />
     *
     * @see <a href="http://be2.php.net/manual/en/function.ceil.php">ceil()</a>
     */
    public static function ceil(Float $number) {
      return new Integer(ceil($number->floatValue()));
    }

    /**
     * Cosine.<br />
     * Returns the cosine of the $number parameter. <br />
     * The $number parameter is in radians.<br />
     *
     * @param integer $number An angle in radians.
     * @return float The cosine of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.cos.php">cos()</a>
     */
    public function Cosine($number) {
      return Math::Cos($number);
    }

    /**
     * Alias of Cosine().<br />
     * @see Cosine().
     */
    public function Cos($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return cos($number);
    }

    /**
     * Hyperbolic cosine.<br />
     * Returns the hyperbolic cosine of $number.<br />
     *
     * @param integer $number The argument to process.
     * @return float The hyperbolic cosine of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.cosh.php">cosh()</a>
     */
    public function CosineHyperbolic($number) {
      return Math::CosH($number);
    }

    /**
     * Alias of CosineHyperbolic().<br />
     * @see CosineHyperbolic().
     */
    public function CosH($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return cosh($number);
    }

    /**
     * Decimal to binary.<br />
     * Returns a string containing a binary representation of the given $number
     * argument.<br />The largest number that can be converted is 4294967295 in
     * decimal resulting to a string of 32 1's.<br />
     *
     * @param integer $number Decimal value to convert.
     * @return string Binary string representation of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.decbin.php">decbin()</a>
     */
    public function DecimalToBinary($number) {
      return Math::DecBin($number);
    }

    /**
     * Alias of DecimalToBinary().<br />
     * @see DecimalToBinary().
     */
    public function DecBin($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return decbin($number);
    }

    /**
     * Decimal to hexadecimal.<br />
     * Returns a string containing a hexadecimal representation of the given
     * $number  argument. The largest number that can be converted is 4294967295
     * in decimal resulting to "ffffffff".<br />
     *
     * @param integer $number Decimal value to convert.
     * @return string Hexadecimal string representation of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.dechex.php">dechex()</a>
     */
    public function DecimalToHexaDecimal($number) {
      return Math::DecHex($number);
    }

    /**
     * Alias of DecimalToHexaDecimal().<br />
     * @see DecimalToHexaDecimal().
     */
    public function DecHex($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return dechex($number);
    }

    /**
     * Decimal to octal.<br />
     * Returns a string containing an octal representation of the given $number
     * argument. The largest number that can be converted is 4294967295 in
     * decimal resulting to "37777777777".<br />
     *
     * @param integer $number Decimal value to convert.
     * @return string Octal string representation of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.decoct.php">decoct()</a>
     */
    public function DecimalToOctal($number) {
      return Math::DecOct($number);
    }

    /**
     * Alias of DecimalToOctal().<br />
     * @see DecimalToOctal().
     */
    public function DecOct($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return decoct($number);
    }

    /**
     * Converts the number in degrees to the radian equivalent.<br />
     * This public function converts $number from degrees to the radian equivalent.<br />
     *
     * @param integer $number Angular value in degrees.
     * @return float The radian equivalent of number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.deg2rad.php">dec2rad()</a>
     */
    public function DegreeToRadian($number) {
      return Math::Deg2Rad($number);
    }

    /**
     * Alias of DegreeToRadian().<br />
     * @see DegreeToRadian().
     */
    public function Deg2Rad($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return deg2rad($number);
    }

    /**
     * Calculates the exponent of e.<br />
     * Returns e raised to the power of $number.
     * Note : 'e' is the base of the natural system of logarithms, or
     * approximately 2.718282.<br />
     *
     * @param integer $number The argument to process.
     * @return float Returns 'e' raised to the power of $number.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.exp.php">exp()</a>
     */
    public function Exponent($number) {
      return Math::Exp($number);
    }

    /**
     * Alias of Exponent().<br />
     * @see Exponent().
     */
    public function Exp($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return exp($number);
    }

    /**
     * Round fractions down.<br />
     * Returns the next lowest integer value by rounding down $number if
     * necessary.<br />
     *
     * @param integer $number The numeric value to round.
     *
     * @return float Returns $number rounded to the next lowest integer. The return value of
     * Floor() is still of type float because the value range of float is
     * usually bigger than that of integer.<br /><br />
     *
     * @see <a href="http://be2.php.net/manual/en/function.floor.php">floor()</a>
     */
    public function Floor($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return floor($number);
    }

    /**
     * Returns the floating point remainder (modulo) of the division of the
     * arguments.<br />
     * Returns the floating point remainder of dividing the dividend $x by the
     * divisor $y. The reminder (r) is defined as: x = i * y + r, for some
     * integer i. If $y is non-zero, r has the same sign as $x and a magnitude
     * less than the magnitude of $y.<br />
     *
     * @param float $x The dividend.
     * @param float $y The divisor.
     * @return float Returns the floating point remainder of x /y.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.fmod.php">fmod()</a>
     */
    public function Modulo($x, $y) {
      return Math::FMod($x, $y);
    }

    /**
     * Alias of Modulo().<br />
     * @see Modulo().
     */
    public function FMod($x, $y) {
      if (Validator::Validate(array($x, $y), Validator::INTEGER))
        return fmod($x, $y);
    }

    /**
     * Show largest possible random value.<br />
     * Returns the maximum value that can be returned by a call to Rand().<br />
     *
     * @return integer The largest possible random value returned by Rand().<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.getrandmax.php">getrandmax()</a>
     */
    public function GetMaxRandom() {
      return getrandmax();
    }

    /**
     * Alias of GetMaxRandom().<br />
     * @see GetMaxRandom().
     */
    public function GetRandMax() {
      return getrandmax();
    }

    /**
     * Show largest possible random value.<br />
     * Returns the maximum value that can be returned by a call to
     * Random($speed).<br />
     *
     * @return integer The maximum random value returned by Random($speed).<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.mt-getrandmax.php">mt_getrandmax()</a>
     */
    public function GetMTMaxRandom() {
      return mt_getrandmax();
    }

    /**
     * Hexadecimal to decimal.<br />
     * Returns the decimal equivalent of the hexadecimal number represented by
     * the $string  argument. HexadecimalToDecimal() converts a hexadecimal
     * string to a decimal number.<br />
     *
     * @param $string The hexadecimal string to convert.
     * @return float The decimal representation of $string.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.hexdec.php">hexdec()</a>
     */
    public function HexadecimalToDecimal($string) {
      return Math::HexDec($string);
    }

    /**
     * Alias of HexadecimalToDecimal().<br />
     * @see HexadecimalToDecimal().
     */
    public function HexDec($string) {
      if (Vallidator::Validate(string, Validator::STRING))
        return hexdec($string);
    }

    /**
     * Calculate the length of the hypotenuse of a right-angle triangle.<br />
     * Returns the length of the hypotenuse of a right-angle triangle with sides
     * of length x  and y , or the distance of the point (x , y ) from the
     * origin. This is equivalent to sqrt(x*x + y*y).<br />
     *
     * @param float $x Length of first side.
     * @param float $y Length of second side.
     * @return float Calculated length of the hypotenuse.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.hypot.php">hypot()</a>
     */
    public function Hypotenuse($x, $y) {
      return Math::Hypot($x, $y);
    }

    /**
     * Alias of Hypotenuse().<br />
     * @see Hypotenuse().
     */
    public function Hypot($x, $y) {
      if (Validator::Validate(array($x, $y), Validator::INTEGER))
        return hypot($x, $y);
    }

    /**
     * Finds whether a value is a legal finite number.<br />
     * Checks whether $number is a legal finite on this platform.<br />
     *
     * @param integer $number The value to check.
     * @return boolean TRUE if $number is a legal finite number within the allowed range
     * for a PHP float on this platform, else FALSE.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.is-finite.php">is_finite()</a>
     */
    public function isFinite($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return is_finite($number);
    }

    /**
     * Finds whether a value is infinite.<br />
     * Returns TRUE if $number is infinite (positive or negative), like the
     * result of log(0) or any value too big to fit into a float on this
     * platform.<br />
     *
     * @param integer $number The value to check.
     * @return boolean TRUE if $number is infinite, else FALSE.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.is-infinite.php">is_infinite()</a>
     */
    public function isInfinite($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return is_infinite($number);
    }

    /**
     * Finds whether a value is not a number.<br />
     * Checks whether $number is 'not a number', like the result of acos(1.01).<br />
     *
     * @param integer $number The value to check.
     * @return boolean TRUE if $number is 'not a number', else FALSE.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.is-nan.php">is_nan()</a>
     */
    public function isNotANumber($number) {
      return Math::isNaN($number);
    }

    /**
     * Alias of isNotANumber().<br />
     * @see isNotANumber().
     */
    public function isNaN($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return is_nan($number);
    }

    /**
     * Combined linear congruential generator.<br />
     * @return float A pseudo random float value in the range of (0, 1).<br /><br />
     * @see <a href="http://fr2.php.net/manual/en/function.lcg-value.php">lcg_value()</a>
     */
    public function GenerateCombinedLinearCongruential() {
      return lcg_value();
    }

    /**
     * Base-10 logarithm.<br />
     * @param float $arg The argument to process.
     * @return float Returns the base-10 logaritm of $arg.<br /><br />
     * @see <a href="http://fr2.php.net/manual/en/function.log10.php">log10()</a>
     */
    public function Logarithm10($arg) {
      if (Validator::Validate($arg, Validator::FLOAT))
        return log10($arg);
    }

    /**
     * Natural logarithm.<br />
     * @param float $number The value to calculate the logarithm for.
     * @return float The natural logarithm of $arg.<br /><br />
     * @see <a href="http://fr2.php.net/manual/en/function.log.php">log()</a>
     */
    public function Logarithm($number) {
      if (Validator::Validate($number, Validator::FLOAT))
        return log($number);
    }

    /**
     * Returns log(1 + number), computed in a way that is accurate even when the
     * value of $number is close to zero.<br />
     * @param float $number The argument to process.
     * @return float Returns log(1 + number ).
     * @see <a href="http://fr2.php.net/manual/en/function.log1p.php">log1p()</a>
     */
    public function Logarithm1P($number) {
      if (Validator::Validate($number, Validator::FLOAT))
        return log1p($number);
    }

    /**
     * Find highest value.<br />
     * Returns the highest value in that array.<br />
     *
     * @param $array An array containing the values.
     * @return float The numerically highest of the parameter values.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.max.php">max()</a>
     */
    public function Maximum($array) {
      return Math::Max($array);
    }

    /**
     * Alias of Maximum().<br />
     * @see Maximum().
     */
    public function Max($array) {
      if (Validator::Validate($array, Validator::VECTOR))
        return max($array);
    }

    /**
     * Find lowest value.<br />
     * Returns the lowest value in that array.<br />
     *
     * @param $array An array containing the values.
     * @return The numerically lowest of the parameter values.<br /><br />
     * @see <a href="http://be2.php.net/manual/en/function.min.php">min()</a>
     */
    public function Minimum($array) {
      return Math::Min($array);
    }

    /**
     * Alias of Minimum().<br />
     * @see Minimum().
     */
    public function Min($array) {
      if (Validator::Validate($array, Validator::VECTOR))
        return min($array);
    }

    /**
     * Generate a random integer.<br />
     * If called without the min , max arguments Random() returns a
     * pseudo-random integer between 0 and RAND_MAX. If you want a random number
     * between 5 and 15 (inclusive), for example, use Rand(5, 15);
     * If speed if provided, it generate a better random value.<br />
     *
     * @param integer $min The lowest value to return (default: 0).
     * @param integer $max The highest value to return (default: RAND_MAX).
     * @param boolean $speed Define if the public function must call mt_rand() or not for a
     * better random value.
     *
     * @return integer A pseudo random value between min  (or 0) and max  (or RAND_MAX, inclusive).<br /><br />
     *
     * @see <a href="http://be.php.net/manual/en/function.rand.php">rand()</a>
     * @see <a href="http://be.php.net/manual/en/function.mt-rand.php">mt_rand()</a>
     */
    public function Random($min = 0, $max = RAND_MAX, $speed = TRUE) {
      return Math::Random($min, $max, $speed);
    }

    /**
     * Alias of Random().<br />
     * @see Random();
     */
    public function Rand($min = 0, $max = RAND_MAX, $speed = TRUE) {
      if (Validator::Validate(array($min, $max), Validator::INTEGER) &&
              Validator::Validate($speed, Validator::BOOLEAN))
        if ($speed)
          return mt_rand($min, $max);
        else
          return rand($min, $max);
    }

    /**
     * Seed the better random number generator.<br />
     * Seeds the random number generator with $seed or with a random value if no
     * seed is given.<br />
     * @param integer $seed An optional seed value.
     * @see <a href="http://be.php.net/manual/en/function.mt-srand.php">mt_srand()</a>
     */
    public function SuperRandom($seed = NULL) {
      if (!empty($seed))
        if (Validator::Validate($seed, Validator::INTEGER))
          return mt_srand($seed);
        else
          return mt_srand();
    }

    /**
     * Alias of SuperRandom().<br />
     * @see SuperRanfom().
     */
    public function SRand($seed = NULL) {
      return SuperRandom($seed);
    }

    /**
     * Octal to decimal.<br />
     * Returns the decimal equivalent of the octal number represented by the
     * $string argument.<br />
     *
     * @param $string The octal string to convert.
     * @return float The decimal representation of $string.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.octdec.php">octdec</a>
     */
    public function OctalToDecimal($string) {
      return Math::OctDec($string);
    }

    /**
     * Alias of OctalToDecimal().<br />
     * @see OctalToDecimal().
     */
    public function OctDec($string) {
      if (Vallidator::Validate(string, Validator::STRING))
        return octdec($string);
    }

    /**
     * Get value of pi.<br />
     * Returns an approximation of pi. The returned float has a precision based
     * on the precision directive in php.ini, which defaults to 14. Also, you
     * can use the M_PI constant which yields identical results to Math::Pi().<br />
     *
     * @return float The value of pi as float.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.pi.php">pi()</a>
     */
    public function Pi() {
      return pi();
    }

    /**
     * @param $base The base to use.<br />
     * @param $exponent The exponent.<br />
     *
     * @return $base raised to the power of $exp. If the result can be
     * represented as integer it will be returned as type integer, else it will
     * be returned as type float. If the power cannot be computed FALSE will be
     * returned instead.<br /><br />
     *
     * @see <a href="http://be.php.net/manual/en/function.pow.php">pow()</a>
     */
    public function Power($base, $exponent) {
      if (Validator::Validate(array($base, $exponent), Validator::INTEGER))
        return pow($base, $exponent);
    }

    /**
     * Converts the radian number to the equivalent number in degrees.<br />
     *
     * @param integer $number A radian value.
     * @return float The equivalent of $number in degrees.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.rad2deg.php">rad2deg()</a>
     */
    public function RadianToDegree($number) {
      return Math::Rad2Deg($number);
    }

    /**
     * Alias of RadianToDegree().<br />
     * @see RadianToDegree().
     */
    public function Rad2Deg($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return rad2deg($number);
    }

    /**
     * Rounds a float.<br />
     * Returns the rounded value of $number to specified precision  (number of
     * digits after the decimal point). $precision can also be negative or zero
     * (default).<br />
     *
     * @param float $number The value to round.
     * @param int $precision The optional number of decimal digits to round to, defaults to 0
     *
     * @return float The rounded value.<br /><br />
     *
     * @see <a href="http://fr2.php.net/manual/en/function.round.php">round()</a>
     */
    public function Round($number, $precision = 0) {
      if (Validator::Validate(array($number, $precision), Validator::INTEGER))
        return round($number, $precision);
    }

    /**
     * Sine.<br />
     * Returns the sine of the $number parameter. The $number parameter is in
     * radians.<br />
     * @param integer $number A value in radians.
     * @return float The sine of $number.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.sin.php">sin()</a>
     */
    public function Sine($number) {
      return Math::Sin($number);
    }

    /**
     * Alias of Sine().<br />
     * @see Sine()
     */
    public function Sin($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return sin($number);
    }

    /**
     * Hyperbolic sine.<br />
     * Returns the hyperbolic sine of $number,
     * defined as (exp(arg) - exp(-arg))/2.<br />
     *
     * @param integer $number The argument to process.
     * @return float The hyperbolic sine of $number.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.sinh.php">sinh()</a>
     */
    public function SineHyperbolic($number) {
      return Math::SinH($number);
    }

    /**
     * Alias of SineHyperbolic().<br />
     * @see SineHyperbolic()
     */
    public function SinH($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return sinh($number);
    }

    /**
     * Square root.<br />
     * Returns the square root of $number.<br />
     *
     * @param integer $number The argument to process.
     * @return float The square root of $number or the special value NAN for negative
     * numbers.<br /><br />
     *
     * @see <a href="http://be.php.net/manual/en/function.sqrt.php">sqrt()</a>
     */
    public function SquareRoot($number) {
      return Math::Sqrt($number);
    }

    /**
     * Alias of SquareRoot().<br />
     * @see SquareRoot()
     */
    public function Sqrt($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return sqrt($number);
    }

    /**
     * Tangent.<br />
     * Returns the tangent of the $number parameter. The $number parameter is in
     * radians.<br />
     *
     * @param integer $number The argument to process in radians.
     * @return float The tangent of $number.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.tan.php">tan()</a>
     */
    public function Tangent($number) {
      return Math::Tan($number);
    }

    /**
     * Alias of Tangent().<br />
     * @see ()
     */
    public function Tan($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return tan($number);
    }

    /**
     * Hyperbolic tangent.<br />
     * Returns the hyperbolic tangent of $number, defined as
     * sinh($number)/cosh($number).<br />
     *
     * @param integer $number The argument to process.
     * @return float The hyperbolic tangent of $number.<br /><br />
     * @see <a href="http://be.php.net/manual/en/function.tanh.php">tanh()</a>
     */
    public function TangentHyperbolic($number) {
      return Math::TanH($number);
    }

    /**
     * Alias of TangentHyperbolic().<br />
     * @see TangentHyperbolic()
     */
    public function TanH($number) {
      if (Validator::Validate($number, Validator::INTEGER))
        return tanh($number);
    }

  }

?>
